import request from "@/request/baseAxios";

// 获取全部用户信息
export const getRolesList = () => {
  return request({
    url: "/api/roles",
    method: "get",
  });
};

export const getAllRolesList = () => {
  return request({
    url: "/api/roles?all=true",
    method: "get",
  });
};

export const updateRole = (id, data) => {
  return request({
    url: `/api/roles/${id}`,
    method: "put",
    data,
  });
};

export const getRoleById = (id) => {
  return request({
    url: `/api/roles/${id}`,
    method: "get",
  });
};

export const deleteRole = (id) => {
  return request({
    url: `/api/roles/${id}`,
    method: "delete",
  });
};
